package com.breakfast.fun.ui.home;

import com.breakfast.fun.base.BaseModel;
import com.breakfast.fun.base.BasePresenter;
import com.breakfast.fun.base.BaseView;
import com.breakfast.fun.data.entity.home.ActivityAd;
import com.breakfast.fun.data.entity.home.CenterAd;
import com.breakfast.fun.data.entity.home.FourAd;
import com.breakfast.fun.data.entity.home.Home;
import com.breakfast.fun.data.entity.home.Notice;
import com.breakfast.fun.data.entity.home.Product;
import com.breakfast.fun.data.entity.home.ProductClasses;
import com.breakfast.fun.data.entity.home.Version;
import com.breakfast.fun.data.entity.home.product.ProductDetail;
import com.breakfast.fun.data.entity.home.product.ProductState;

import java.util.List;
import java.util.Map;

import retrofit2.http.FieldMap;
import rx.Observable;

/**
 * Created by hp on 2016/8/16.
 */
public interface HomeContract {

    interface Model extends BaseModel {
        Observable<Home> getHomeModel(@FieldMap Map<String, String> map);

        Observable<Version> getVersionModel(@FieldMap Map<String, String> map);

        Observable<ProductDetail> getProductModel(@FieldMap Map<String, String> map);

        Observable<ProductState> getProductStateModel(@FieldMap Map<String, String> map);
    }

    interface View extends BaseView {
        //        void addGallery(List<Products> productses, List<Notice> notices,String moreTipUrl);
        void addBanner(List<CenterAd> centerAds);

        void addType(List<Product> hotProducts, List<Product> newProducts);

        void refreshData(Home home);

        void loadMoreProduct(ProductDetail hotProducts);

        void stopRefesh();

        void showAd(ActivityAd activityAd);

        void showFailure();

        void updateVersion(Version version);

        void clear();

        void addTypeIcon(List<ProductClasses> productClasses, List<FourAd> dailyActivity, List<Notice> notices, List<CenterAd> noticeTimes);

        void setProductState(ProductState productState);
    }

    abstract class Presenter extends BasePresenter<Model, View> {
        public abstract void getHome();

        public abstract void refresh();

        public abstract void loadMore(int page);

        public abstract void checkVersion();

        public abstract void getProductState();
    }
}
